/**
 * 
 */
package com.igatewebsol.daoimpl;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @author R
 *
 */
public class BaseDAOImpl {
	//Testing commit code
	public Connection getDBConnection(){
		Connection conn=null;
		 try
         {
			 Class.forName ("com.mysql.jdbc.Driver").newInstance ();
             String userName = "root";
             String password = "root";
             String url = "jdbc:mysql://localhost/hotelprojectdb";
             
             conn = DriverManager.getConnection (url, userName, password);
             System.out.println ("Database connection established");
         }
         catch (Exception e)
         {
        	 e.printStackTrace();
             System.err.println ("Cannot connect to database server");
         }
         return conn;
	}
	
	public static void main(String args[]){
		BaseDAOImpl baseDAOImpl= new BaseDAOImpl();
		
		Connection con1=baseDAOImpl.getDBConnection();
		
		
	}

}
